#include <bits/stdc++.h>

using namespace std;

class Solution
{
public:
    int change(int amount, vector<int> &coins)
    {
        vector<size_t> dp(amount + 1, 0);
        dp[0] = 1;
        for (int i = 0; i < (int)coins.size(); i++)
        {
            for (int j = coins[i]; j <= amount; j++)
            {
                dp[j] = dp[j] + dp[j - coins[i]];
            }
        }
        return dp[amount];
    }
};

int main()
{
    vector<int> coins{1, 2, 5};
    Solution sol;
    cout << sol.change(5, coins) << endl;
    return 0;
}